package com.diver.flinkdemo.controller;/**
 * @author yangs
 */

import com.alibaba.fastjson.JSONObject;
import com.diver.flinkdemo.utils.FlinkThreadUtil;
import com.diver.flinkdemo.utils.Trd.XyRequestUtil;
import com.diver.flinkdemo.utils.TrdUrlUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * @author yangs
 */
@Slf4j
public class XiaoYangDealController {
    private FlinkThreadUtil threadUtil = new FlinkThreadUtil();

    private XyRequestUtil xyRequestUtil = new XyRequestUtil();

    public void xiaoYangDeal(String data){
        threadUtil.threadPoolExecutor().submit(new Runnable() {
            @Override
            public void run() {
                log.info("处理：{}", data);
                JSONObject jo = JSONObject.parseObject(data);
                String url = TrdUrlUtil.xyUrl + jo.getString("url");
                String result = xyRequestUtil.post(url, jo.getJSONObject("params"));
            }
        });
//        log.info("小羊{} 返回:{}", jo.getString("url"), result);
    }
}
